package mashuaiproject.mashuaiproject.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;
import mashuaiproject.mashuaiproject.model.CommentSon;

import java.util.List;

@Component
public interface CommentSonMapper {
    @Insert("insert into commentson(father_id,content,gmt_create,gmt_modified,quesion_id,user_id)" +
            "values(#{father_id},#{content},#{gmt_create},#{gmt_modified},#{quesion_id},#{user_id})")
    int inserSonComment(CommentSon comments );

    @Select("select *from commentson where father_id=#{father_id}")
    List<CommentSon> selectAllCommentSon(@Param("father_id") Integer fatherId);

}
